package com.ueboot.weishop.entity.activity;

import com.ueboot.weishop.entity.IDEntity;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Date;

/**
 * 描述:活动众筹 开奖期次中奖结果表
 *
 * @since 1.0
 */
@Data
@NoArgsConstructor
@Entity(name = "WS_CROW_RESULT")
public class CrowResultEntity extends IDEntity {

    /**
     * 不下发DMS
     */
    public static final Integer ISSUE_DMS_0 = 0;
    /**
     * 下发DMS
     */
    public static final Integer ISSUE_DMS_1 = 1;
    /**
     * 下发中
     */
    public static final Integer ISSUE_DMS_2 = 2;
    /**
     * 已下发
     */
    public static final Integer ISSUE_DMS_3 = 3;
    /**
     * 中奖
     */
    public static final String LOTTERY_YES = "中奖";
    /**
     * 未中奖
     */
    public static final String LOTTERY_NO = "未中奖";

    @Id
    @GeneratedValue(strategy = GenerationType.TABLE, generator = "WS_CROW_RESULT")
    @GenericGenerator(name = "WS_CROW_RESULT", strategy = "enhanced-table", parameters = {
            @org.hibernate.annotations.Parameter(name = "table_name", value = "WS_TABLE_SEQUENCE"),
            @org.hibernate.annotations.Parameter(name = "segment_value", value = "WS_CROW_RESULT"),
            @org.hibernate.annotations.Parameter(name = "optimizer", value = "pooled")})
    @Column(name = "ID", columnDefinition = "INT(20) COMMENT 'id主键'", length = 20)
    private Long id;

    /**
     * 订单编号
     */
    @Column(name = "ORDER_NO", columnDefinition = "VARCHAR(50) COMMENT '订单编号'", length = 50)
    private String orderNo;

    /**
     * 活动名称
     */
    @Column(name = "ACTIVITY_NAME", columnDefinition = "VARCHAR(200) COMMENT '所属活动名称'", length = 200)
    private String activityName;

    /**
     * 产品名称
     */
    @Column(name = "GOODS_NAME", columnDefinition = "VARCHAR(200) COMMENT '产品名称'", length = 200)
    private String goodsName;

    /**
     * 活动代码
     */
    @Column(name = "ACTIVITY_CODE", columnDefinition = "VARCHAR(50) COMMENT '所属活动代码'", length = 50)
    private String activityCode;

    /**
     * 开奖期次
     */
    @Column(name = "PERIOD_NUM", columnDefinition = "VARCHAR(50) COMMENT '开奖期次'", length = 50)
    private String periodNum;

    /**
     * 中奖客户名称
     */
    @Column(name = "CUSTOMER", columnDefinition = "VARCHAR(50) COMMENT '中奖客户名称'", length = 50)
    private String customer;

    /**
     * 中奖客户vin
     */
    @Column(name = "CUSTOMER_VIN", columnDefinition = "VARCHAR(50) COMMENT '中奖客户vin'", length = 50)
    private String customerVin;

    /**
     * 中奖客户手机号
     */
    @Column(name = "CUSTOMER_MOBILE", columnDefinition = "VARCHAR(20) COMMENT '中奖客户手机号'", length = 20)
    private String customerMobile;

    /**
     * 中奖客户微信唯一编码
     */
    @Column(name = "OPEN_ID", columnDefinition = "VARCHAR(50) COMMENT '中奖客户微信唯一编码'", length = 50)
    private String openId;

    /**
     * 开奖时间
     */
    @Column(name = "OPEN_DATE", columnDefinition = "DATE COMMENT '开奖时间'")
    private Date openDate;

    /**
     * 开奖号码
     */
    @Column(name = "LOTTERY_NUM", columnDefinition = "VARCHAR(50)  COMMENT '开奖号码'", length = 50)
    private String lotteryNum;

    /**
     * 中奖结果，中奖，未中奖
     */
    @Column(name = "LOTTERY", columnDefinition = "VARCHAR(50)  COMMENT '中奖结果，中奖，未中奖'", length = 50)
    private String lottery;

    /**
     * 开奖金额:单位分
     */
    @Column(name = "AMOUNT", columnDefinition = "INT(50)  COMMENT '开奖金额：单位分'", length = 50)
    private Integer amount = 0;

    /**
     * 是否发DMS，1下发，0不下发
     */
    @Column(name = "ISSUE_DMS", columnDefinition = "INT(50)  COMMENT '是否发DMS，1下发，0不下发'", length = 50)
    private Integer issueDms = ISSUE_DMS_0;
}